package com.efast.cafe.portal.controller.doc;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.efast.cafe.framework.bean.ResultBean;
import com.efast.cafe.framework.controller.AbstractController;
import com.efast.cafe.framework.exception.ServiceException;
import com.efast.cafe.portal.entity.doc.PortalCompanyUser;
import com.efast.cafe.portal.service.doc.IDocUserService;

@Controller
@RequestMapping("/doc")
public class DocUserController  extends  AbstractController{
	
	@Autowired
	private IDocUserService docUserService;

	@RequestMapping(value="/user/list")
	public @ResponseBody ResultBean queryAttrList(@RequestBody PortalCompanyUser portalCompanyUser){
		ResultBean result = new ResultBean(true,null);
		try {
			result.setObject(docUserService.queryDocUserlist(portalCompanyUser));
		} catch (Exception e) {
			e.printStackTrace();
			result.setSuccess(false);
			if (e instanceof ServiceException) {
				result.setErrorCode(e.getMessage());
			} else {
				result.setErrorCode(ResultBean.ERROR_CODE_SYSTEM);
			}
		}
		
		return result;
	}
	}
